
export interface StartResponse {
    /** 倒计时 */
    countdown: number,
    /** 游戏id */
    game_id: string,
    /** 玩具的id */
    entity_ids: Array<number>,
    /** 当前的积分 */
    current_score: number,
    /** 当前的最大关卡 */
    current_max_level: number,
    /** 道具剩余情况 */
    free_props: { [key: string]: number },
    /** 道具是否可用 */
    prop_usable: boolean
}

export interface StartRequest {
    /** 开始游戏的关卡索引 */
    level: number
}

export interface JoinResponse {
    current_max_level: number,
    current_score: number
}

/**
 * 
 * 上行消除消息
 * 
 */
export interface EliminateMessage {
    type: string;
    user_id: number;

    game_id: string;
    /** 道具id */
    prop_id: number;
    /** 赢得的分数 */
    win_score: number;
    /** 消除的是哪个id */
    entity_id: number;
}

/**
 * 
 * 游戏结束上行消息
 * 
 */
export interface EliminateOver {
    type: string;
    user_id: number;
    game_id: string;
    stop_reason: GameStopReason;
    level: number;
}


export interface EliminateMatchMessage {
    /** 道具id */
    prop_id: number,
    /** 消除的id */
    entity_id: number,
    /** 游戏id */
    game_id: string,
    app: string,
    /** 当前的分数 */
    current_score: number,
    /** 用户id */
    user_id: number,
    /** 道具剩余情况 */
    free_props?: { [key: string]: number }
}

/**
 * 
 * 游戏结束类型
 * 
 */
export enum GameStopReason {
    COUNTDOWN_OVER = "countdown",
    CLEAR = "clear",
    FORCE_CLOSE = "force_close"
}